from engine import connect

def books():
    #查询books表
    conn = connect()
    ret = conn.execute("select * from books")
    result = ret.fetchall() #获取记录集
    print(result)   #以元组形式输出结果
    ret.close() #关闭数据库连接

if __name__ == '__main__':
    books()